#include "ScriptMgr.h"
#include "PlayerScript.h"
#include "Player.h"
#include "Config.h"
#include "Chat.h"
#include "Define.h"
#include "MapMgr.h"

class WdsScript : public PlayerScript
{
public:
    WdsScript() : PlayerScript("MyPlayer") { }

    void OnBindToInstance(Player* player, Difficulty difficulty, uint32 mapId, bool permanent)override{
         if (sConfigMgr->GetOption<bool>("wds.Enable", false))
            {
                uint32 instanceId = player->GetInstanceId();
                Map* m = MapMgr::instance()->FindMap(mapId,instanceId);
                ChatHandler(player->GetSession()).PSendSysMessage("%s:%s",player->GetName(), m->GetMapName());
            }
    }
};

// Add all scripts in one
void AddWdsScripts()
{
    new WdsScript();
}
